<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//RU" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">-->
{doctype}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing Poligon - CI 2.0 &amp; JQuery 1.5</title>
<script type="text/javascript" src="{jquery_url}"></script>
<script type="text/javascript" src="{jquery_ui_url}"></script>
{main_style}
{ui_style}
{wisywig_load}
<script type="text/javascript">
$(document).ready(function(){
        var bold = 0;
        $('#bold').click(function(){
                //FrameDoc.execCommand("Strikethrough", false, '');
                if(bold == 0){
                        $(this).css('background-color', 'gray');
                        bold = 1;
                        }
                else {
                        $(this).css('background-color', 'white');
                        bold = 0;
                        }
                FrameDoc.execCommand("Bold", false, '');
                Frame.focus();
        });
        var Textarea = document.getElementById('textarea_id');
        var Container = document.createElement("DIV");

        Textarea.parentNode.insertBefore(Container, Textarea);
        Container.appendChild(Textarea);
        Textarea.style.display = 'none';

        var iframe = "<iframe style='width: 50%; height: 50%; border: solid black 1px;' src=\"javascript: document.open(); document.domain='" +
        document.domain + "'; document.close();\" frameborder='0'></iframe>";

        Container.innerHTML =  iframe + Container.innerHTML;
        var Frame = Container.childNodes[0];

        var isIE = /*@cc_on!@*/false;

        var FrameDoc = isIE ? Frame.contentWindow.document : Frame.contentDocument;

        FrameDoc.open();

        FrameDoc.write('<html><head></head><body>'+ Textarea.value +'&nbsp;</body></html>');
        FrameDoc.close();
        FrameDoc.designMode = "on";

        $('#tabs').tabs();

        tinyMCE.init({
        theme : "advanced",
        mode : "textareas",
        document_base_url : "http://192.168.10.124/js/tm"
});

});
</script>
</head>
<body>
        <div id="bold" style="cursor: url; border: solid black 1px; width: 15px;">B</div>
        <div id="textarea">
                <textarea id="textarea_id"> </textarea>
        </div>
        <div id="tabs" style="width: 250px; font-size: 12px;">
                   <ul>
                      <li><a href="#tabs-1">Tab 1</a></li>
                      <li><a href="#tabs-2">Tab 2</a></li>
                      <li><a href="#tabs-3">Tab 3</a></li>
                   </ul>
                   <div id="tabs-1">
                      <p>Tab 1 content</p>
                   </div>
                   <div id="tabs-2">
                      <p>Tab 2 content</p>
                   </div>
                   <div id="tabs-3">
                      <p>Tab 3 content</p>
                   </div>
        </div>
        <div id="tinymce">
                <textarea></textarea>
        </div>
</body>
</html>